Skip to main content link. Accesskey S
  • Help
  • HCL Logo
  • HCL Notes and Domino Application Development wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

Community articleXpages - changing the color of a single cell in a view Panel based on a field value
Added by ~Kim Froresatherings | Edited by ~Kim Froresatherings on July 18, 2010 | Version 2
expanded Abstract
collapsed Abstract
In Lotus Notes, it is possible to add view columns that "Use value as color". This can be used to change the background color and/or text color of the entire row or just a specific cell. There are already articles on the Wiki that cover setting alternating row colors or changing the color of the entire row. This article focuses on how to change the color of just one cell depending on the value of a document.
Tags: View Column color, Xpages view column color, Xpages
The demonstration database contains products, which have "units in stock" and a "reorder level". When the standard Products view is displayed in Lotus Notes, a hidden column with "Use value as color" has been placed just before the "Units in Stock" column with the formula:
 
@If(UnitsInStock<=ReorderLevel;255:0:0:-1:-1:-1;-1:-1:-1:-1:-1:-1) 
 
This has the effect of changing the background color of the units in stock to red if the value is at or below the reorder level - time to buy some more!! 
 
The same effect is possible in Xpages. An attached PDF shows the screen shots accompanying the steps.
 
1) Add a hidden column to your view that contains the information that you will use to decide whether to apply the color or not. The column is required so that we can access the information in it once the view has been added to the Xpage. Hide it because we don't want to confuse anyone who will continue to access the native view in Lotus Notes. In this example, we already have the Units in Stock in the view, but we will also need to know the reorder level. A column was added to the view to hold the value of the reorder level.
 
2) Create a stylesheet (or modify an existing one already on the Xpage). Add in a classs with a background color: in this case 'redBackground'
 
3) Create a new XPage (or modify an existing one)
 
4) Add the stylesheet resource that contains your class to the Xpage from the Styles tab of the Properties panel for the XPage
 
5) From the Container Controls panel on the right-hand side of the Designer client, drag and drop a  "View" Control onto the XPage. In the dialog box that appears, select the view and click OK
 
6) Hide the Reorder level column and column header by unticking the "visible" property check box
 
 
 
 
 
expanded Attachments (0)
collapsed Attachments (0)
expanded Versions (5)
collapsed Versions (5)
Version Comparison     
VersionDateChanged by              Summary of changes
5Aug 9, 2010, 12:56:39 PM~Andy Elresaplopettu  
4Jul 18, 2010, 12:40:56 PM~Kim Froresatherings  
3Jul 18, 2010, 12:33:30 PM~Kim Froresatherings  
This version (2)Jul 18, 2010, 12:20:31 PM~Kim Froresatherings  
1Jul 18, 2010, 11:54:01 AM~Kim Froresatherings  
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL
  • Privacy
  • Accessibility